home *** CD-ROM | disk | FTP | other *** search
- ' the Person class is used to test inheritance
-
- Public Class Person
- Public Const Title As String = "Mr. "
-
- Public FirstName As String
- Public LastName As String
-
- Function CompleteName() As String
- CompleteName = FirstName & " " & LastName
- End Function
-
-
- End Class
-
- ' The Employee class inherits from Person
-
- Class Employee
- Inherits Person
-
- Public BirthDate As Date ' A new field
-
- Function ReverseName() As String ' A new method
- ReverseName = LastName & ", " & FirstName
- End Function
- End Class
-
- ' an example of structure that contains a fixed length string
-
- Structure PersonStruct
- Dim FirstName As String
- Dim LastName As String
- Public Address As String
- Private SSN As String
-
- ' Simulate a fixed-length string.
- Dim ZipCode As Microsoft.VisualBasic.Compatibility.VB6.FixedLengthString
-
- ' A constructor for this structure.
- Sub New(ByVal firstName As String, ByVal lastName As String)
- Me.FirstName = FirstName
- Me.LastName = LastName
- ' Initialize the fixed-length string.
- ZipCode = New Microsoft.VisualBasic.Compatibility.VB6.FixedLengthString(10)
- End Sub
-
-
- Function CompleteName() As String
- CompleteName = FirstName & " " & LastName
- End Function
- End Structure
-
- ' a class used to test performance of operation shorthands
-
- Class Test
- Public Value As Integer
- End Class
-
-